package edu.sctu.wangfuxin.day20150614.testIO;

import java.io.*;

/**
 * Created by user06 on 2015/6/24.
 */
public class TestPrintStream2 {
    public static void list(String f,PrintStream fs){
        try {
            BufferedReader br = new BufferedReader(new FileReader(f));
            String s = null;

            while((s=br.readLine())!=null){
                fs.println(s);
            }
            br.close();
        } catch (IOException e) {
            System.out.println("无法找到文件！");
        }
    }

    public static void main(String[] args) {
        String fileName = "D:\\TestIO\\testPrintReader.txt";
        if(fileName != null){
           list(fileName,System.out);
        }
    }
}
